'use strict';

var config = require('../config/index.js');
var assert = require('assert');
var appUtils = require('../common/app_utils.js');

describe('token', function () {
  // this is from api server
  var checked = {
    uid: '68',
    manager: 1,
    time: 1450082106858,
    md5Src: '_AA_uid=68&manager=1&time=1450082106858_BB_',
    md5Value: '6a09709ab2099e21e0d3ab456ded7102',
    token: 'uid%3D68%26manager%3D1%26time%3D1450082106858%26md5%3D6a09709ab2099e21e0d3ab456ded7102'
  };

  it('生成 token', function () {
    var token1 = appUtils.genToken(checked.uid, checked.manager, checked.time);
    assert.equal(token1, checked.token);
  });
});